<?php
class Default_Model_View extends Zend_Db_Table_Abstract
{
    protected $_name = 'view';
    public function getData($data=array()){
        $query = $this->select()
                        ->from(array('v'=>$this->_name))
                        ->where('v.ip like ?',$data['ip'])
                        ->where('v.proId=?', $data['proId']);
        return $this->fetchRow($query);
    }
    public function addData($data){        
        $id=$this->insert($data, $this->_name);
        return $id;
    }   
    public function updateData($id, $data=array()){
        return $this->update($data, 'id = '.(int)$id);
    }      
}